package com.by.component.website.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

@Getter
@AllArgsConstructor
public enum WebsitePageSceneTypeEnum {

    MP_LEARN_CENTER(1, "学习中心"),
    MP_COURSE_MENU(2, "课件目录"),
    MP_COURSE_WARE(3, "课件详情"),
    MP_HOMEPAGE(4, "首页"),
    MP_CONTRACT_LIST(5, "合同列表"),
    MP_PROMOTION_LANDING_PAGE(6, "推广落地页"),
    MP_MARKET_PAGE_RELA(7, "营销购买页"),
    MP_USER_PERSONAL_CENTER(8, "个人中心"),
    MP_SIGN_CONTRACT(9, "签署合同"),
    MP_ALI_RETURN_URL(10, "支付宝返回地址"),
    MP_ALI_QUIT_URL(11, "支付宝退出地址"),
    OPERATION_STAGE_DELIVERY_PERSON(12, "运营阶段交付人员"),
    SPU_RECEIVE_INVITE_LINK(13, "接量邀请链接"),
    MP_COURSE_WARE_WITH_INVITE(14, "带邀请码的课件链接"),
    MP_COURSE_WARE_WITH_ADJUST(15, "带调班码的课件链接"),
    MP_MARKET_PAGE_RELA_SELF_AMOUNT(16, "营销购买页-自定义付款金额"),
    MP_PROMOTION_LANDING_PAGE_V2(17, "推广落地页V2"),
    MA_COURSE_WARE_WITH_ADJUST_IFRAME(18, "小程序带调班码的课件链接（iframe）"),
    MA_COURSE_WARE_STUDY(19, "小程序课件上课链接"),
    ;

    private Integer code;
    private String desc;

    private static final Map<Integer, WebsitePageSceneTypeEnum> MAP = Arrays.stream(WebsitePageSceneTypeEnum.values())
            .collect(Collectors.toMap(WebsitePageSceneTypeEnum::getCode, Function.identity()));

    public static WebsitePageSceneTypeEnum resolve(Integer code) {
        return MAP.get(code);
    }


}
